<page-header [autoTitle]="false"></page-header>
<nz-card>
  <section class="search-section">
    <input nz-input placeholder="提交用户、所属店铺" [(ngModel)]="keyword" class="search-item"/>
    <nz-select [(ngModel)]="status" [nzPlaceHolder]="'状态'" class="search-item" [nzAllowClear]="true"
               [nzShowSearch]="true">
      <nz-option
        *ngFor="let option of statusOption"
        [nzLabel]="option.value"
        [nzValue]="option.key">
      </nz-option>
    </nz-select>
    <button nz-button [nzType]="'primary'" nzGhost (click)="search()"  class="search-item">
      <i class="anticon anticon-search"></i><span>搜索</span>
    </button>
  </section>
  <nz-table #nzTable [nzData]="page.content"
            [nzPageSize]="page.size"
            [nzTotal]="page.totalElements"
            [nzFrontPagination]="false"
            [(nzPageIndex)]="page.number"
            (nzPageIndexChange)="changePageNo($event)"
            [nzLoading]="isLoading">
    <thead>
    <tr>
      <th nz-th><span>序号</span></th>
      <th nz-th><span>提交用户</span></th>
      <th nz-th><span>所属店铺</span></th>
      <th nz-th><span>获得积分</span></th>
      <th nz-th><span>提交时间</span></th>
      <th nz-th><span>状态</span></th>
      <th nz-th><span>操作</span></th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of nzTable.data;let i=index">
      <td>
        {{i+1}}
      </td>
      <td>{{data.cusName}}（{{data.currShopRole|dicsNamePipe:otcShopCusRole}}）</td>
      <td title="{{data.shopTitle}}">{{data.shopTitle|stringEllipsisCutPipe:12}}</td>
      <td>{{data.credit}}({{data.currShopRole == 4?"普通积分":"TAK积分"}})</td>
      <td>{{data.saveDate}}</td>
      <td>{{data.status|dicsNamePipe:statusOption}}</td>
      <td>
        <a href="javascript:void (0);" (click)="seeEntity(data)">查看详情</a>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>
